package com.main.dao;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.main.mybatis.common.datasource.DatabaseContextHolder;
import com.main.mybatis.common.datasource.DatabaseType;
import com.main.mybatis.mapper.UserMapper;
import com.main.pojo.Userinfo;

@Repository
public class UserInfoDao {

	@Autowired
	private UserMapper mapper;
	
	/**
     * 获取shop
     */
    public Userinfo getUserinfo(int id) {
        DatabaseContextHolder.setDatabaseType(DatabaseType.mytestdb2);
        return mapper.getUserinfo(id);
    }
    
    /**
     * 获取shop
     */
    public Userinfo getUserinfo2(int id) {
        DatabaseContextHolder.setDatabaseType(DatabaseType.mytestdb);
        return mapper.getUserinfo(id);
    }

}
